package com.springboot.shanhexin.service;

import com.springboot.shanhexin.dao.userinfoDao;
import com.springboot.shanhexin.entity.userinfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class userinfoService {

    @Autowired
    private userinfoDao userinfoDao;

    /**
     * 显示总数量
     * @return
     */
    public int getCount() {
        return userinfoDao.getCount();
    }

    /**
     * 全部分页显示
     * @return
     */
    public List<userinfo> findByPage(int pos, int size) {
        return userinfoDao.findByPage(pos, size);
    }

    /**
     * 显示搜索的总数量
     * @return
     */
    public int getsearchCount(String key,String name) {
        return userinfoDao.getsearchCount(key,name);
    }

    /**
     * 搜索并分页显示
     * @return
     */
    public List<userinfo> findsearchByPage(String key,String name,int pos, int size) {
        return userinfoDao.findsearchByPage(key,name,pos, size);
    }

}
